//
//  ViewController.m
//  book
//
//  Created by mac on 15-12-4.
//  Copyright (c) 2015年 lee. All rights reserved.
//

#import "ViewController.h"
#import "ReadViewController.h"
@interface ViewController ()

{
    NSMutableArray *bookList;
}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.title = @"某某读书器";
    bookList = @[
                 @"射雕英雄传",
                 @"天龙八部",
                 @"神雕侠侣"
                 ].mutableCopy;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return bookList.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *yinbin = @"bookList";
    
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:yinbin];
    
    
    cell.textLabel.text = bookList[indexPath.row];
    
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:yinbin];
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    ReadViewController *con = [[ReadViewController alloc]initWithStyle:UITableViewStyleGrouped];
    con.text = @"askdhnali;hfas ca bc,z,nck;lka ;sfhaw oah'cassadkjanbksjdabsdkjabdkajbsdjbnash gfkhavo";
    [self.navigationController pushViewController:con animated:YES];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
